package com.bawei.week.sing

import androidx.lifecycle.MutableLiveData
import com.bawei.lib_base.entity.SingBean
import com.bawei.lib_base.entity.SingBeanItem
import com.bawei.lib_base.mvvm.BaseViewModel
import com.bawei.lib_base.utils.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SingViewModel @Inject constructor(val apiService: ApiService) : BaseViewModel(){

    val sing= MutableLiveData<SingBeanItem>()

    val singUserId = MutableLiveData<SingBean>()

    fun getSing(map: Map<String,Any>){
        httpRetrofit({apiService.getSing(mapToBody(map))},sing :: postValue)
    }

    fun getSingUserId(userId : Int){
        httpRetrofit({apiService.getSingUserId(userId)},singUserId :: postValue)
    }
}